// 初始化按钮状态
/**
 *
 * @param isEdit 是否编辑状态
 * @param isEmptyPsn  nextprops 的selectedPsn是否为空
 */
export default function updateSubButtonStatus(isEdit, isEmptyPsn) {
    const {areaCode} = this.state;
    const {selectedPsn, editTable, func_type} = this.props;
    const length = editTable.getAllRows(areaCode).length;
    this.props.button.setButtonDisabled({
        addline: isEmptyPsn || !selectedPsn || isEdit,
        insertline: (func_type === 3 && areaCode === 'hi_psndoc_dimission') || isEmptyPsn || !selectedPsn || isEdit || !length,
        editline: isEmptyPsn || !selectedPsn || isEdit || !length,
        deleteline: (func_type === 3 && areaCode === 'hi_psndoc_dimission') || isEmptyPsn || !selectedPsn || isEdit || !length,
        save: !isEdit,
        cancel: !isEdit
    });
}
